package context;

import bean.DBConfig;
import bean.PolicyDO;
import bean.User;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import service.list.Adaptor;

import java.util.Arrays;

/**
 * ClassPathXmlApplicationContext 测试类
 *
 * @author kerry dong
 */
public class XmlContext {

	public static void main(String[] args) {
		AbstractApplicationContext context = new ClassPathXmlApplicationContext("application-content.xml");
		//ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("./${abc}");
		//User user = context.getBean(User.class);
		//PolicyDO policy = context.getBean(PolicyDO.class);
		//Object bean1 = context.getBean("policy-service");
		DBConfig bean = context.getBean(DBConfig.class);
		System.out.println(bean);
		//ConfigCenterBFPP bfpp = context.getBean(ConfigCenterBFPP.class);
		Object centerBFPP = context.getBean("centerBFPP");
		System.out.println(centerBFPP);
		String[] beanDefinitionNames = context.getBeanDefinitionNames();
		System.out.println(Arrays.toString(beanDefinitionNames));
		Adaptor adaptor = context.getBean(Adaptor.class);
		System.out.println(adaptor);
	}
}
